package climspace.data;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 * Entity implementation class for Entity: WeatherStation
 * Author: dnguyen
 *
 */
@Entity
@NamedQueries( {
	@NamedQuery(name = "findWeatherStations", query = "SELECT e FROM WeatherStation e ORDER BY e.primary_id"),
	@NamedQuery(name = "findWeatherStation", query = "SELECT e from WeatherStation e WHERE e.primary_id = :primary_id and e.station_status = 'ACTIVE' order by e.entry_date desc"),
	@NamedQuery(name = "getWeatherData", query = "SELECT e,f from WeatherStation e, WeatherData f WHERE e.primary_id = :primary_id and f.primary_id = :primary_id and e.primary_id=f.primary_id and e.station_status='ACTIVE'")})
@Table(name = "WeatherStation")	
public class WeatherStation implements Serializable {
	
	private static final long serialVersionUID = -763402024940802604L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	Long id;
	
	@Column(nullable = true)
	String primary_id;
	
	/*@OneToOne(optional=false)
	@JoinColumn(name = "primary_id") 
	private WeatherData weatherData;*/
		
	@Column(nullable = true)
	String secondary_id;
	
	@Column(nullable = true)
	String station_name;
	
	@Column(nullable = true)
	String state;
	
	@Column(nullable = true)
	String country;
	
	@Column(nullable = true)
	String latitude;
	
	@Column(nullable = true)
	String longitude;
	
	@Column(nullable = true)
	String elevation;
	
	@Column(nullable = true)
	String mesowest_network_id;
	
	@Column(nullable = true)
	String network_name;
	
	@Column(nullable = true)
	String station_status;
	
	@Column(nullable = true)
	String primary_provider_id;
	
	@Column(nullable = true)
	String primary_provider;
	
	@Column(nullable = true)
	String secondary_provider_id;
	
	@Column(nullable = true)
	String secondary_provider;
	
	@Column(nullable = true)
	String tertiary_provider_id;
	
	@Column(nullable = true)
	String tertiary_provider;
	
	@Column(nullable = true)
	Date entry_date = new Date();

	public WeatherStation() {
		super();
	}

	public String getSecondary_id() {
		return secondary_id;
	}


	public void setSecondary_id(String secondary_id) {
		this.secondary_id = secondary_id;
	}


	public String getStation_name() {
		return station_name;
	}


	public void setStation_name(String station_name) {
		this.station_name = station_name;
	}


	public String getState() {
		return state;
	}


	public void setState(String state) {
		this.state = state;
	}


	public String getCountry() {
		return country;
	}


	public void setCountry(String country) {
		this.country = country;
	}


	public String getLatitude() {
		return latitude;
	}


	public void setLatitude(String latitude) {
		this.latitude = latitude;
	}


	public String getLongitude() {
		return longitude;
	}


	public void setLongitude(String longitude) {
		this.longitude = longitude;
	}


	public String getElevation() {
		return elevation;
	}


	public void setElevation(String elevation) {
		this.elevation = elevation;
	}


	public String getMesowest_network_id() {
		return mesowest_network_id;
	}


	public void setMesowest_network_id(String mesowest_network_id) {
		this.mesowest_network_id = mesowest_network_id;
	}


	public String getNetwork_name() {
		return network_name;
	}


	public void setNetwork_name(String network_name) {
		this.network_name = network_name;
	}


	public String getStation_status() {
		return station_status;
	}


	public void setStation_status(String station_status) {
		this.station_status = station_status;
	}


	public String getPrimary_provider_id() {
		return primary_provider_id;
	}


	public void setPrimary_provider_id(String primary_provider_id) {
		this.primary_provider_id = primary_provider_id;
	}


	public String getPrimary_provider() {
		return primary_provider;
	}


	public void setPrimary_provider(String primary_provider) {
		this.primary_provider = primary_provider;
	}


	public String getSecondary_provider_id() {
		return secondary_provider_id;
	}


	public void setSecondary_provider_id(String secondary_provider_id) {
		this.secondary_provider_id = secondary_provider_id;
	}


	public String getSecondary_provider() {
		return secondary_provider;
	}


	public void setSecondary_provider(String secondary_provider) {
		this.secondary_provider = secondary_provider;
	}


	public String getTertiary_provider_id() {
		return tertiary_provider_id;
	}


	public void setTertiary_provider_id(String tertiary_provider_id) {
		this.tertiary_provider_id = tertiary_provider_id;
	}

	public String getTertiary_provider() {
		return tertiary_provider;
	}

	public void setTertiary_provider(String tertiary_provider) {
		this.tertiary_provider = tertiary_provider;
	}

	public String getPrimary_id() {
		return primary_id;
	}

	public void setPrimary_id(String primary_id) {
		this.primary_id = primary_id;
	}

	public Long getId() {
		return id;
	}

	public void setId(Long id) {
		this.id = id;
	}

	public Date getEntry_date() {
		return entry_date;
	}

	public void setEntry_date(Date entry_date) {
		this.entry_date = entry_date;
	}
}
